﻿Friend Class ExceptionForm

    Public Event CloseApplication()
    Public Event GoOnApplication()

    Public Shadows Function ShowDialog(ByVal ex As Exception)

        lblMessage.Text = ex.Message
        lblStackTrace.Text = ex.StackTrace

        Return MyBase.ShowDialog()
    End Function

    Private Sub ExceptionForm_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
        e.Graphics.DrawRectangle(Drawing.Pens.Red, New System.Drawing.Rectangle(0, 0, Me.Width - 1, Me.Height - 1))
    End Sub

    Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
        RaiseEvent CloseApplication()
        Me.Close()
    End Sub

    Private Sub btnGoOn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGoOn.Click
        RaiseEvent GoOnApplication()
        Me.Close()
    End Sub
End Class